IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'spTdocuments_Update')
	BEGIN
		PRINT 'Dropping Procedure spTdocuments_Update'
		DROP  Procedure  spTdocuments_Update
	END

GO

PRINT 'Creating Procedure spTdocuments_Update'
GO
Create Procedure dbo.spTdocuments_Update
	( 	  
		@d_id varchar(50), 
		@d_status varchar(50) = null, 
		@d_match bit = null, 
		@d_exist bit = null, 
		@d_folder varchar(50) = null, 
		@d_loc varchar(50) = null, 
		@d_accno varchar(50) = null, 
		@d_fileno varchar(50) = null, 
		@d_doctype varchar(50) = null, 
		@d_stand varchar(50) = null, 
		@d_suburb varchar(50) = null, 
		@d_complex varchar(50) = null, 
		@d_custid varchar(50) = null, 
		@d_custname1 varchar(100) = null, 
		@d_custname2 varchar(100) = null, 
		@d_lasttran DateTime = null, 
		@d_user varchar(50) = null, 
		@d_goldate DateTime = null, 
		@d_mbno varchar(50) = null, 
		@d_tdno varchar(50) = null, 
		@d_hogno varchar(50) = null, 
		@d_onwins varchar(50) = null, 
		@d_owninsno varchar(50) = null, 
		@d_lifecomp varchar(50) = null, 
		@d_lifeno varchar(50) = null, 
		@d_lifecess varchar(50) = null, 
		@d_lifewaiver DateTime = null, 
		@d_govtee varchar(50) = null, 
		@d_letsure DateTime = null, 
		@d_nhbrc bit = null, 
		@d_authpmt bit = null, 
		@d_gpadate DateTime = null, 
		@d_addendum varchar(50) = null, 
		@d_notes varchar(8000) = null, 
		@d_releasetype varchar(50) = null, 
		@d_releasereason varchar(500) = null, 
		@d_primaryattorney varchar(100) = null, 
		@d_secondaryattorney varchar(100) = null, 
		@d_notifyreturned bit = null, 
		@d_releasedate DateTime = null, 
		@d_returndate DateTime = null, 
		@d_primaryattorneyletterreference varchar(50) = null, 
		@d_secondaryattorneyletterreference varchar(50) = null, 
		@d_trackingnumber varchar(100) = null
	)
AS
  /* 
    ------------------------------------------------------------------------------
    - Change History
    - --------------
    - Date          Description
    ------------------------------------------------------------------------------
    - 8/22/2007    Initial version Updated
    ------------------------------------------------------------------------------
  */

	-- Declare the required variables

	-- Update the required new record
	UPDATE Tdocuments
	SET
		d_status = @d_status, 
		d_match = @d_match, 
		d_exist = @d_exist, 
		d_folder = @d_folder, 
		d_loc = @d_loc, 
		d_accno = @d_accno, 
		d_fileno = @d_fileno, 
		d_doctype = @d_doctype, 
		d_stand = @d_stand, 
		d_suburb = @d_suburb, 
		d_complex = @d_complex, 
		d_custid = @d_custid, 
		d_custname1 = @d_custname1, 
		d_custname2 = @d_custname2, 
		d_lasttran = @d_lasttran, 
		d_user = @d_user, 
		d_goldate = @d_goldate, 
		d_mbno = @d_mbno, 
		d_tdno = @d_tdno, 
		d_hogno = @d_hogno, 
		d_onwins = @d_onwins, 
		d_owninsno = @d_owninsno, 
		d_lifecomp = @d_lifecomp, 
		d_lifeno = @d_lifeno, 
		d_lifecess = @d_lifecess, 
		d_lifewaiver = @d_lifewaiver, 
		d_govtee = @d_govtee, 
		d_letsure = @d_letsure, 
		d_nhbrc = @d_nhbrc, 
		d_authpmt = @d_authpmt, 
		d_gpadate = @d_gpadate, 
		d_addendum = @d_addendum, 
		d_notes = @d_notes, 
		d_releasetype = @d_releasetype, 
		d_releasereason = @d_releasereason, 
		d_primaryattorney = @d_primaryattorney, 
		d_secondaryattorney = @d_secondaryattorney, 
		d_notifyreturned = @d_notifyreturned, 
		d_releasedate = @d_releasedate, 
		d_returndate = @d_returndate, 
		d_primaryattorneyletterreference = @d_primaryattorneyletterreference, 
		d_secondaryattorneyletterreference = @d_secondaryattorneyletterreference, 
		d_trackingnumber = @d_trackingnumber		
	WHERE d_id = @d_id

	-- Return to calling method
	RETURN
	
GO
